
	function doCheckPassword()
	{
		var newPassword = $("#txtNewPass").val();
		var cnfPassword = $("#txtConfirmPassword").val();
		var hdnUserName = $("#hdnUserName").val();
		var message ="";
		if(newPassword.length==0)
		{
			message +="Please enter your new password";
			message +="\n";
		}
		if(cnfPassword.length==0)
		{
			message +="Please enter confirm password";
			message +="\n";
		}
		if(message.length!=0)
		{
			alert(message);
			return false;
		}
		else
		{
			if(newPassword==cnfPassword)
			{
				$.post("admin-actions.php",{action:"change-password",newPassword:newPassword,hdnUserName:hdnUserName},function(data){
					if(data==1)
					{
						alert("Password Successfully changed.");
						return true;
					}
					else
					{
						alert("The server was too busy. Please try some time later.");
						return true;
					}
				},"text");
			}
			else
			{
				alert("Password do not match");
				return false;
			}
		}
		return true;
	}

	function doCheckNumber()
	{
		var txtContactNumber = $("#txtContactNumber").val();
		if(txtContactNumber.length!=0)
		{
			$.post("admin-actions.php",{action:"change-number",txtContactNumber:txtContactNumber},function(data){
				if(data==1)
				{
					alert("Contact Number Successfully Updated.");
					return true;
				}
				else
				{
					alert("The server was too busy. Please try some time later.");
					return true;
				}
				},"text");
		
		}
		else
		{
			alert("Please enter a contact number");
			return false;
		}
		
	}
	
	function doCheckEmail()
	{
		var txtContactEmail = $("#txtContactEmail").val();
		if(txtContactEmail.length!=0)
		{
			$.post("admin-actions.php",{action:"change-email",txtContactEmail:txtContactEmail},function(data){
				if(data==1)
				{
					alert("Contact Email Successfully Updated.");
					return true;
				}
				else
				{
					alert("The server was too busy. Please try some time later.");
					return true;
				}
				},"text");
		
		}
		else
		{
			alert("Please enter a Email address");
			return false;
		}
	}
	
	function addFeedBack()
	{
		var txtCusName = $("#txtCusName").val();
		//alert(txtCusName);
		var txtCusCountry = $("#txtCusCountry").val();
		//alert(txtCusCountry);
		var selectGender = $("#selectGender").val();
		//alert(selectGender);
		var txtAreaFeedback = $('textarea#txtAreaFeedback').val();
		//alert(txtAreaFeedback);
		
		var message ="";
		if(txtCusName.length==0)
		{
			message +="Please enter customer name";
			message +="\n";
		}
		if(txtCusCountry.length==0)
		{
			message +="Please enter customer Country";
			message +="\n";
		}
		if(selectGender.length==0)
		{
			message +="Please enter customer Gender";
			message +="\n";
		}
		if(txtAreaFeedback.length==0)
		{
			message +="Please enter Feedback";
			message +="\n";
		}
		if(selectGender=='select')
		{
			message +="Please Select a gender";
			message +="\n";
		}
		
		if(message.length!=0)
		{
			alert(message);
			return false;
		}
		else
		{
			$.post("admin-actions.php",{action:"add-feedback",txtCusName:txtCusName,txtCusCountry:txtCusCountry,selectGender:selectGender,txtAreaFeedback:txtAreaFeedback},function(data){
				if(data==1)
				{
					alert("Feedback Successfully added.");
					return true;
				}
				else
				{
					alert("The server was too busy. Please try some time later.");
					return true;
				}
				},"text");
		
		}
		
	}
	
	function editPack(id)
	{
		if(id=="")
		{
			alert("Please select one package to edit");
			return false;
		}
		else
		{
			document.getElementById(id+"_id").style.display="none";
			document.getElementById(id+"_id_edit").style.display="block";
		}
	}
	
	function updatePackage(id)
	{
		var txtplans = $("#plans").val();
		var txtprice = $("#price").val();
		var txtvalidity = $("#validity").val();
		var txtpcs = $("#pcs").val();
		var txtadditionalpc = $("#additionalpc").val();
		$.post("admin-actions.php",{action:"update-package",id:id,txtadditionalpc:txtadditionalpc,txtpcs:txtpcs,txtplans:txtplans,txtprice:txtprice,txtvalidity:txtvalidity},function(data){
			if(data==1)
			{
				alert("Package Successfully Updated.");
				return true;
			}
			else
			{
				alert("The server was too busy. Please try some time later.");
				return true;
			}
			},"text");
	}
	function addPackage()
	{
		var txtplans = $("#plans").val();
		var txtprice = $("#price").val();
		var txtvalidity = $("#validity").val();
		var txtpcs = $("#pcs").val();
		var txtadditionalpc = $("#additionalpc").val();
		$.post("admin-actions.php",{action:"add-package",txtadditionalpc:txtadditionalpc,txtpcs:txtpcs,txtplans:txtplans,txtprice:txtprice,txtvalidity:txtvalidity},function(data){
			if(data==1)
			{
				alert("Package Successfully added.");
				return true;
			}
			else
			{
				alert("The server was too busy. Please try some time later.");
				return true;
			}
			},"text");
	}
	function deletePack(id)
	{
		if(id.length!=0)
		{
			$.post("admin-actions.php",{action:"delete-package",id:id},function(data){
				if(data==1)
				{
					alert("Package Successfully deleted.");
					return true;
				}
				else
				{
					alert("The server was too busy. Please try some time later.");
					return true;
				}
				},"text");
		}
	}
